
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>附录 工具库 · 计算机笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="海拉尔的三角">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro-fixed/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-ancre-navigation/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-insert-logo-link-website/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-auto-scroll-table/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex-pro/katex.min.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-terminull-light/terminull.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../../MySQL/mysql.html" />
    
    
    <link rel="prev" href="monotoneStack_withNum.html" />
    

    
        <link rel="shortcut icon" href="image/ico.png" type="image/x-icon">
    
    
    
    
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="image/ico.png">
    
    
        
    
    
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://github.com/spite-triangle" target="_blank" class="custom-link">Github</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../cpp.html">
            
                <a href="../cpp.html">
            
                    
                    C/C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="foundation_withNum.html">
            
                <a href="foundation_withNum.html">
            
                    
                    一、基础概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="keyword_withNum.html">
            
                <a href="keyword_withNum.html">
            
                    
                    二、关键字
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="point_reference_withNum.html">
            
                <a href="point_reference_withNum.html">
            
                    
                    三、指针与引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="oop_withNum.html">
            
                <a href="oop_withNum.html">
            
                    
                    四、面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="memory_withNum.html">
            
                <a href="memory_withNum.html">
            
                    
                    五、内存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="process_withNum.html">
            
                <a href="process_withNum.html">
            
                    
                    六、进程与线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="locks_withNum.html">
            
                <a href="locks_withNum.html">
            
                    
                    七、锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="stl_withNum.html">
            
                <a href="stl_withNum.html">
            
                    
                    八、STL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="dataStruction_withNum.html">
            
                <a href="dataStruction_withNum.html">
            
                    
                    九、数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.10" data-path="array_list_withNum.html">
            
                <a href="array_list_withNum.html">
            
                    
                    十、数组链表操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.11" data-path="find_withNum.html">
            
                <a href="find_withNum.html">
            
                    
                    十一、目标查找
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.12" data-path="tree_withNum.html">
            
                <a href="tree_withNum.html">
            
                    
                    十二、树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.13" data-path="binaryTree_withNum.html">
            
                <a href="binaryTree_withNum.html">
            
                    
                    十三、二叉树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.14" data-path="dynamicProgram_withNum.html">
            
                <a href="dynamicProgram_withNum.html">
            
                    
                    十四、动态规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.15" data-path="backtracking_withNum.html">
            
                <a href="backtracking_withNum.html">
            
                    
                    十五、回溯算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.16" data-path="monotoneStack_withNum.html">
            
                <a href="monotoneStack_withNum.html">
            
                    
                    十六、单调栈
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.1.17" data-path="toollib_withNum.html">
            
                <a href="toollib_withNum.html">
            
                    
                    附录 工具库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../../MySQL/mysql.html">
            
                <a href="../../MySQL/mysql.html">
            
                    
                    MySQL
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="../../MySQL/chapter/introduction_withNum.html">
            
                <a href="../../MySQL/chapter/introduction_withNum.html">
            
                    
                    一、简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="../../MySQL/chapter/foundation_withNum.html">
            
                <a href="../../MySQL/chapter/foundation_withNum.html">
            
                    
                    二、控制台操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="../../MySQL/chapter/operatorDB_withNum.html">
            
                <a href="../../MySQL/chapter/operatorDB_withNum.html">
            
                    
                    三、数据库、表操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4" data-path="../../MySQL/chapter/operatorData_withNum.html">
            
                <a href="../../MySQL/chapter/operatorData_withNum.html">
            
                    
                    四、数据操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5" data-path="../../MySQL/chapter/transaction_withNum.html">
            
                <a href="../../MySQL/chapter/transaction_withNum.html">
            
                    
                    五、事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6" data-path="../../MySQL/chapter/index_withNum.html">
            
                <a href="../../MySQL/chapter/index_withNum.html">
            
                    
                    六、索引
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.7" data-path="../../MySQL/chapter/authority_withNum.html">
            
                <a href="../../MySQL/chapter/authority_withNum.html">
            
                    
                    七、权限管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.8" data-path="../../MySQL/chapter/backup_withNum.html">
            
                <a href="../../MySQL/chapter/backup_withNum.html">
            
                    
                    八、备份
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../../linux/linux.html">
            
                <a href="../../linux/linux.html">
            
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../../linux/chapter/foundation_withNum.html">
            
                <a href="../../linux/chapter/foundation_withNum.html">
            
                    
                    一、原理知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../../linux/chapter/command_withNum.html">
            
                <a href="../../linux/chapter/command_withNum.html">
            
                    
                    二、指令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../../tcp_udp/tcp_upd.html">
            
                <a href="../../tcp_udp/tcp_upd.html">
            
                    
                    网络
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="../../tcp_udp/chapter/foundation_withNum.html">
            
                <a href="../../tcp_udp/chapter/foundation_withNum.html">
            
                    
                    一、网络通讯基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2" data-path="../../tcp_udp/chapter/tcp_udp_withNum.html">
            
                <a href="../../tcp_udp/chapter/tcp_udp_withNum.html">
            
                    
                    二、tcp/udp
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >附录 工具库</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><span class="title-icon "></span><a href="#&#x5DE5;&#x5177;&#x5E93;"><b></b>&#x5DE5;&#x5177;&#x5E93;</a></li><li><span class="title-icon "></span><a href="#1-math"><b></b>1. math</a></li><li><span class="title-icon "></span><a href="#2-regex"><b></b>2. regex</a></li><li><span class="title-icon "></span><a href="#3-&#x533F;&#x540D;&#x51FD;&#x6570;"><b></b>3. &#x533F;&#x540D;&#x51FD;&#x6570;</a></li></ul></div><a href="#&#x5DE5;&#x5177;&#x5E93;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 style="font-size:60px;text-align:center;" id="&#x5DE5;&#x5177;&#x5E93;"><a name="&#x5DE5;&#x5177;&#x5E93;" class="anchor-navigation-ex-anchor" href="#&#x5DE5;&#x5177;&#x5E93;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5DE5;&#x5177;&#x5E93;</h1>

<h1 id="1-math"><a name="1-math" class="anchor-navigation-ex-anchor" href="#1-math"><i class="fa fa-link" aria-hidden="true"></i></a>1. math</h1>
<pre class="language-"><code class="lang-cpp"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span><span class="token string">&lt;math.h&gt;</span></span>

<span class="token comment">// &#x7EDD;&#x5BF9;&#x503C;</span>
<span class="token keyword">int</span> <span class="token function">abs</span><span class="token punctuation">(</span><span class="token keyword">int</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">double</span> <span class="token function">fabs</span><span class="token punctuation">(</span><span class="token keyword">double</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">// &#x56DB;&#x820D;&#x4E94;&#x5165;</span>
<span class="token keyword">double</span> <span class="token function">round</span><span class="token punctuation">(</span><span class="token keyword">double</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">// &#x53D6;&#x6574;</span>
<span class="token keyword">double</span> <span class="token function">ceil</span><span class="token punctuation">(</span><span class="token keyword">double</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// &#x5411;&#x4E0A;&#x53D6;&#x6574;</span>
<span class="token keyword">double</span> <span class="token function">floor</span><span class="token punctuation">(</span><span class="token keyword">double</span> num<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// &#x5411;&#x4E0B;&#x53D6;&#x6574;</span>

<span class="token comment">// &#x4F59;&#x6570;</span>
<span class="token keyword">double</span> <span class="token function">fmod</span><span class="token punctuation">(</span><span class="token keyword">double</span> num&#xFF0C;<span class="token keyword">double</span> base<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token operator">%</span><span class="token punctuation">;</span> &#x53EA;&#x80FD;&#x7528;&#x4E8E;<span class="token keyword">int</span><span class="token punctuation">;</span>
</code></pre>
<h1 id="2-regex"><a name="2-regex" class="anchor-navigation-ex-anchor" href="#2-regex"><i class="fa fa-link" aria-hidden="true"></i></a>2. regex</h1>
<ul>
<li><code>\b</code> : &#x5B57;&#x7B26;&#x8FB9;&#x754C;</li>
<li><code>.</code> : &#x9664; <code>\n</code> &#x4EE5;&#x5916;&#x6240;&#x6709;&#x5B57;&#x7B26;</li>
<li><code>\w</code> : &#x7B49;&#x4EF7;&#x4E8E; <code>[(0-9)(a-z)(A-Z)(_)]</code> &#xFF0C;&#x6570;&#x5B57;&#xFF0C;&#x5B57;&#x6BCD;&#xFF0C;&#x4E0B;&#x5212;&#x7EBF;</li>
<li><code>\W</code> : &#x4E0A;&#x9762;&#x53D6;&#x53CD; <code>[^(0-9)(a-z)(A-Z)(_)]</code></li>
<li><code>\d</code> : &#x6570;&#x5B57;</li>
<li><code>\D</code> : &#x4E0A;&#x9762;&#x53D6;&#x53CD;</li>
<li><code>\s</code> : &#x7A7A;&#x767D;&#x7B26;(&#x7A7A;&#x683C;&#xFF0C;&#x5236;&#x8868;&#x7B26;&#xFF0C;&#x6362;&#x884C;)</li>
<li><code>\S</code> : &#x4E0A;&#x9762;&#x53D6;&#x53CD;</li>
<li><code>regex_search</code> : <font color="#f44336">&#x53EA;&#x8FD4;&#x56DE;&#x7B2C;&#x4E00;&#x6B21;&#x5339;&#x914D;&#x5230;&#x7684;&#x5B50;&#x4E32;</font></li>
<li><font color="#4c9df8">&#x4E0A;&#x9762;&#x7684;&#x5339;&#x914D;&#x5B57;&#x7B26;&#xFF0C;&#x7F16;&#x7A0B;&#x7528;&#x65F6;&#x8FD8;&#x8981;&#x518D;&#x52A0;&#x4E00;&#x4E2A; `\` </font>

</li>
</ul>
<pre class="language-"><code class="lang-cpp"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;regex&gt;</span></span>

<span class="token comment">// &#x5B9A;&#x4E49;&#x8868;&#x8FBE;&#x5F0F;</span>
regex <span class="token function">reg</span><span class="token punctuation">(</span><span class="token string">&quot;[a-z0-9]+&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment">// &#x662F;&#x5426;&#x5339;&#x914D;</span>
<span class="token keyword">bool</span> <span class="token function">regex_match</span><span class="token punctuation">(</span>string<span class="token punctuation">,</span>regex<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//&#x5168;&#x5339;&#x914D;</span>
<span class="token keyword">bool</span> <span class="token function">regex_search</span><span class="token punctuation">(</span>string<span class="token punctuation">,</span>regex<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//&#x5B50;&#x4E32;&#x5339;&#x914D;&#xFF0C;&#x53EA;&#x5339;&#x914D;&#x7B2C;&#x4E00;&#x6B21;&#x627E;&#x5230;&#x7684;</span>

<span class="token comment">// &#x6355;&#x83B7;</span>
<span class="token keyword">bool</span> <span class="token function">reg_search</span><span class="token punctuation">(</span>string&#xFF0C;smatch&#xFF0C;regex<span class="token punctuation">)</span><span class="token punctuation">;</span>
smatch<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//&#x5339;&#x914D;&#x5230;&#x7684;&#x4E2A;&#x6570;: &#x8868;&#x8FBE;&#x5F0F;&#x5339;&#x914D; + &#x6355;&#x83B7;&#x5339;&#x914D;</span>
smatch<span class="token punctuation">.</span><span class="token function">str</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// &#x6574;&#x4E2A;&#x6B63;&#x5219;&#x5339;&#x914D;&#x5230;&#x7684;&#x90E8;&#x5206;</span>
smatch<span class="token punctuation">.</span><span class="token function">str</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 0&#x4E4B;&#x540E;&#x7684;&#xFF0C;&#x90FD;&#x662F;&#x6355;&#x83B7;&#x90E8;&#x5206;</span>
smatch<span class="token punctuation">.</span><span class="token function">prefix</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">str</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// &#x672A;&#x5339;&#x914D;&#x7684;&#x524D;&#x90E8;&#x5206;</span>
smatch<span class="token punctuation">.</span><span class="token function">prefix</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">str</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// &#x672A;&#x5339;&#x914D;&#x7684;&#x540E;&#x90E8;&#x5206;</span>
</code></pre>
<h1 id="3-&#x533F;&#x540D;&#x51FD;&#x6570;"><a name="3-&#x533F;&#x540D;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#3-&#x533F;&#x540D;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x533F;&#x540D;&#x51FD;&#x6570;</h1>
<blockquote>
<p>[!note]
<strong>&#x53EA;&#x6709;<code>c++11</code>&#x4EE5;&#x4E0A;&#x7684;&#x7F16;&#x8BD1;&#x5668;&#x624D;&#x652F;&#x6301;&#x3002;</strong></p>
</blockquote>
<pre class="language-"><code class="lang-cpp"><span class="token punctuation">[</span>capture<span class="token punctuation">]</span> <span class="token punctuation">(</span>Parameters<span class="token punctuation">)</span> <span class="token operator">-&gt;</span>return_type<span class="token punctuation">{</span>
    body<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<ul>
<li><p><code>capture</code>:</p>
<pre class="language-"><code class="lang-cpp">  <span class="token punctuation">[</span><span class="token punctuation">]</span>        <span class="token comment">//&#x672A;&#x5B9A;&#x4E49;&#x53D8;&#x91CF;.&#x8BD5;&#x56FE;&#x5728;Lambda&#x5185;&#x4F7F;&#x7528;&#x4EFB;&#x4F55;&#x5916;&#x90E8;&#x53D8;&#x91CF;&#x90FD;&#x662F;&#x9519;&#x8BEF;&#x7684;.</span>
    <span class="token punctuation">[</span>x<span class="token punctuation">,</span> <span class="token operator">&amp;</span>y<span class="token punctuation">]</span>   <span class="token comment">//x &#x6309;&#x503C;&#x6355;&#x83B7;, y &#x6309;&#x5F15;&#x7528;&#x6355;&#x83B7;.</span>
    <span class="token punctuation">[</span><span class="token operator">&amp;</span><span class="token punctuation">]</span>       <span class="token comment">//&#x7528;&#x5230;&#x7684;&#x4EFB;&#x4F55;&#x5916;&#x90E8;&#x53D8;&#x91CF;&#x90FD;&#x9690;&#x5F0F;&#x6309;&#x5F15;&#x7528;&#x6355;&#x83B7;</span>
    <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">]</span>       <span class="token comment">//&#x7528;&#x5230;&#x7684;&#x4EFB;&#x4F55;&#x5916;&#x90E8;&#x53D8;&#x91CF;&#x90FD;&#x9690;&#x5F0F;&#x6309;&#x503C;&#x6355;&#x83B7;</span>
    <span class="token punctuation">[</span><span class="token operator">&amp;</span><span class="token punctuation">,</span> x<span class="token punctuation">]</span>    <span class="token comment">//x&#x663E;&#x5F0F;&#x5730;&#x6309;&#x503C;&#x6355;&#x83B7;. &#x5176;&#x5B83;&#x53D8;&#x91CF;&#x6309;&#x5F15;&#x7528;&#x6355;&#x83B7;</span>
    <span class="token punctuation">[</span><span class="token operator">=</span><span class="token punctuation">,</span> <span class="token operator">&amp;</span>z<span class="token punctuation">]</span>   <span class="token comment">//z&#x6309;&#x5F15;&#x7528;&#x6355;&#x83B7;. &#x5176;&#x5B83;&#x53D8;&#x91CF;&#x6309;&#x503C;&#x6355;&#x83B7;</span>
</code></pre>
<blockquote>
<p>[!note|style:flat]
<strong><code>[this](){this-&gt;;}</code> &#x5BF9;&#x4E8E; <code>this</code>&#x53EA;&#x80FD;&#x7528;&#x503C;&#x6355;&#x83B7;&#x3002;</strong></p>
</blockquote>
</li>
<li><code>parameters</code>: &#x53C2;&#x6570;&#x5217;&#x8868;</li>
<li><code>return_type</code>: &#x8FD4;&#x56DE;&#x503C;</li>
</ul>
<pre class="language-"><code class="lang-cpp"><span class="token function">sort</span><span class="token punctuation">(</span>vec<span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>vec<span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">const</span> Entry <span class="token operator">&amp;</span> A<span class="token punctuation">,</span><span class="token keyword">const</span> Entry <span class="token operator">&amp;</span> B<span class="token punctuation">)</span> <span class="token operator">-&gt;</span> <span class="token keyword">bool</span><span class="token punctuation">{</span>
        <span class="token keyword">return</span> A<span class="token punctuation">.</span>val <span class="token operator">&gt;</span> B<span class="token punctuation">.</span>val<span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="monotoneStack_withNum.html" class="navigation navigation-prev " aria-label="Previous page: 十六、单调栈">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../../MySQL/mysql.html" class="navigation navigation-next " aria-label="Next page: MySQL">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"附录 工具库","level":"2.1.17","depth":2,"next":{"title":"MySQL","level":"3.1","depth":1,"path":"MySQL/mysql.md","ref":"./MySQL/mysql.md","articles":[{"title":"一、简介","level":"3.1.1","depth":2,"path":"MySQL/chapter/introduction_withNum.md","ref":"MySQL/chapter/introduction_withNum.md","articles":[]},{"title":"二、控制台操作","level":"3.1.2","depth":2,"path":"MySQL/chapter/foundation_withNum.md","ref":"MySQL/chapter/foundation_withNum.md","articles":[]},{"title":"三、数据库、表操作","level":"3.1.3","depth":2,"path":"MySQL/chapter/operatorDB_withNum.md","ref":"MySQL/chapter/operatorDB_withNum.md","articles":[]},{"title":"四、数据操作","level":"3.1.4","depth":2,"path":"MySQL/chapter/operatorData_withNum.md","ref":"MySQL/chapter/operatorData_withNum.md","articles":[]},{"title":"五、事务","level":"3.1.5","depth":2,"path":"MySQL/chapter/transaction_withNum.md","ref":"MySQL/chapter/transaction_withNum.md","articles":[]},{"title":"六、索引","level":"3.1.6","depth":2,"path":"MySQL/chapter/index_withNum.md","ref":"MySQL/chapter/index_withNum.md","articles":[]},{"title":"七、权限管理","level":"3.1.7","depth":2,"path":"MySQL/chapter/authority_withNum.md","ref":"MySQL/chapter/authority_withNum.md","articles":[]},{"title":"八、备份","level":"3.1.8","depth":2,"path":"MySQL/chapter/backup_withNum.md","ref":"MySQL/chapter/backup_withNum.md","articles":[]}]},"previous":{"title":"十六、单调栈","level":"2.1.16","depth":2,"path":"cpp/chapter/monotoneStack_withNum.md","ref":"cpp/chapter/monotoneStack_withNum.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-pro-fixed","expandable-chapters-small","ancre-navigation","hide-element","code","splitter","insert-logo-link-website","-sharing","sharing-plus","prism","-highlight","flexible-alerts","lightbox","pageview-count","auto-scroll-table","katex-pro","favicon-absolute","sectionx","terminull-light","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"],"lang":{"flow":"typescript"}},"livereload":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"auto-scroll-table":{},"code":{"copyButtons":true},"terminull-light":{},"search-pro-fixed":{},"favicon-absolute":{"favicon":"image/ico.png","appleTouchIconPrecomposed152":"image/ico.png","appleTouchIconMore":{},"appleTouchIconPrecomposedMore":{}},"hide-element":{"elements":[".gitbook-link"]},"katex-pro":{},"fontsettings":{"theme":"white","family":"sans","size":2},"sectionx":{"tag":"b"},"lightbox":{"jquery":true,"sameUuid":false},"insert-logo-link-website":{"url":"image/logo.png","link":"https://space.bilibili.com/27206875","target":"_blank","style":"height: 230px"},"pageview-count":{},"ancre-navigation":{"showLevel":true,"associatedWithSummary":true,"mode":"float","printLog":false,"multipleH1":true,"float":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""},"pageTop":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""}},"expandable-chapters-small":{},"flexible-alerts":{"style":"callout","note":{"label":"Note","icon":"fa fa-info-circle","className":"info"},"tip":{"label":"Tip","icon":"fa fa-lightbulb-o","className":"tip"},"warning":{"label":"Warning","icon":"fa fa-exclamation-triangle","className":"warning"},"danger":{"label":"Attention","icon":"fa fa-ban","className":"danger"}},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":false,"facebook":false,"weibo":true,"whatsapp":false,"twitter":false,"pocket":false,"google":true,"qzone":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"海拉尔的三角","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"计算机笔记","links":{"sidebar":{"Github":"https://github.com/spite-triangle"}},"gitbook":"*"},"file":{"path":"cpp/chapter/toollib_withNum.md","mtime":"2021-09-14T15:43:12.972Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-09-14T15:43:23.052Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro-fixed/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro-fixed/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-insert-logo-link-website/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-auto-scroll-table/plugin.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-terminull-light/terminull.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

